﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FJASPX.Framwork.Model;

namespace FJASPX.Framwork.Service
{
    public interface IRepository<T> : IEntityPagedQueryable<T> where T : Entity
    {
        T Get(object id);

        T SafeGet(object id);

        void Refresh(object entity);

        void Insert(T entity);

        void Update(T entity);

        void DeleteById(object id);

        void DeleteByIds(object[] ids);

        void Delete(T entity);

        IList<T> GetAll();
        IList<T> GetAll(string orderBy, bool isAsc);
        void Flush();
        /// <summary>
        /// 保存或更新
        /// </summary>
        /// <param name="entity"></param>
        void Save(T entity);
    }
}
